package cn.xuewenbao.edu.controller;


import cn.xuewenbao.edu.entity.ColumnType;
import cn.xuewenbao.edu.service.ColumnTypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 专栏名称表 前端控制器
 * </p>
 *
 * @author mafayu
 * @since 2021-04-19
 */
@RestController
@RequestMapping("/edu/column-type")
@Api(tags = "专栏类型表")
@Slf4j
public class ColumnTypeController {
    @Autowired
    private ColumnTypeService columnTypeService;

    //所有专栏类型
    @ApiOperation(value = "获取所有专栏类型")
    @GetMapping("/getAllColumnType")
    public Result<?> getAllColumnType(){
        Result<List<ColumnType>> result = new Result<>();
        List<ColumnType> list = columnTypeService.list();
        if (list == null) {
            result.setSuccess(false);
            result.setMessage("查找内容类型失败");
            return result;
        }
        result.setSuccess(true);
        result.setResult(list);
        return result;
    }
}

